#!/bin/bash
set -e -x

cd $(dirname $0)/..
VERSION=${VERSION:-$(./scripts/version)}

mkdir -p bin
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-extldflags -static -s"
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/longhorn-manager
